<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::RubyGemsGemInstaller - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Gem::Installer
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-base64digest-21">#base64digest!</a>
    <li class="calls-super" ><a href="#method-i-build_extensions">#build_extensions</a>
    <li ><a href="#method-i-check_executable_overwrite">#check_executable_overwrite</a>
    <li ><a href="#method-i-checksum_type">#checksum_type</a>
    <li ><a href="#method-i-generate_plugins">#generate_plugins</a>
    <li ><a href="#method-i-hexdigest-21">#hexdigest!</a>
    <li ><a href="#method-i-install">#install</a>
    <li class="calls-super" ><a href="#method-i-pre_install_checks">#pre_install_checks</a>
    <li ><a href="#method-i-prepare_extension_build">#prepare_extension_build</a>
    <li class="calls-super" ><a href="#method-i-spec">#spec</a>
    <li ><a href="#method-i-strict_rm_rf">#strict_rm_rf</a>
    <li ><a href="#method-i-validate_bundler_checksum">#validate_bundler_checksum</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::RubyGemsGemInstaller">
    <h1 id="class-Bundler::RubyGemsGemInstaller" class="class">
      class Bundler::RubyGemsGemInstaller
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-build_extensions" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">build_extensions</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="build_extensions-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 67</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">build_extensions</span>
  <span class="ruby-identifier">extension_cache_path</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:bundler_extension_cache_path</span>]
  <span class="ruby-identifier">extension_dir</span> = <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">extension_dir</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">extension_cache_path</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">extension_dir</span>
    <span class="ruby-identifier">prepare_extension_build</span>(<span class="ruby-identifier">extension_dir</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">build_complete</span> = <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">extension_cache_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;gem.build_complete&quot;</span>), <span class="ruby-value">:read</span>, <span class="ruby-operator">&amp;</span><span class="ruby-value">:file?</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">build_complete</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value">:force</span>]
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">extension_dir</span>)) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkpath</span> <span class="ruby-identifier">p</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">extension_cache_path</span>) <span class="ruby-keyword">do</span>
      <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp_r</span> <span class="ruby-identifier">extension_cache_path</span>, <span class="ruby-identifier">extension_dir</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">prepare_extension_build</span>(<span class="ruby-identifier">extension_dir</span>)
    <span class="ruby-keyword">super</span>
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">extension_cache_path</span>.<span class="ruby-identifier">parent</span>, <span class="ruby-operator">&amp;</span><span class="ruby-value">:mkpath</span>)
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">extension_cache_path</span>) <span class="ruby-keyword">do</span>
      <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp_r</span> <span class="ruby-identifier">extension_dir</span>, <span class="ruby-identifier">extension_cache_path</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_executable_overwrite" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_executable_overwrite</span><span
                                class="method-args">(filename)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_executable_overwrite-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_executable_overwrite</span>(<span class="ruby-identifier">filename</span>)
  <span class="ruby-comment"># Bundler needs to install gems regardless of binstub overwriting</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_plugins" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_plugins</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_plugins-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 48</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_plugins</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Installer</span>.<span class="ruby-identifier">instance_methods</span>(<span class="ruby-keyword">false</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-value">:generate_plugins</span>)

  <span class="ruby-identifier">latest</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">stubs_for</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>).<span class="ruby-identifier">first</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">latest</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">latest</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">version</span>

  <span class="ruby-identifier">ensure_writable_dir</span> <span class="ruby-ivar">@plugins_dir</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">plugins</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">remove_plugins_for</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-ivar">@plugins_dir</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">regenerate_plugins_for</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-ivar">@plugins_dir</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install</span>
  <span class="ruby-identifier">pre_install_checks</span>

  <span class="ruby-identifier">run_pre_install_hooks</span>

  <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">loaded_from</span> = <span class="ruby-identifier">spec_file</span>

  <span class="ruby-comment"># Completely remove any previous gem files</span>
  <span class="ruby-identifier">strict_rm_rf</span> <span class="ruby-identifier">gem_dir</span>
  <span class="ruby-identifier">strict_rm_rf</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">extension_dir</span>

  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">gem_dir</span>, <span class="ruby-value">:create</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-identifier">gem_dir</span>, <span class="ruby-value">:mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0o755</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">extract_files</span>

  <span class="ruby-identifier">build_extensions</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">extensions</span>.<span class="ruby-identifier">any?</span>
  <span class="ruby-identifier">write_build_info_file</span>
  <span class="ruby-identifier">run_post_build_hooks</span>

  <span class="ruby-identifier">generate_bin</span>
  <span class="ruby-identifier">generate_plugins</span>

  <span class="ruby-identifier">write_spec</span>

  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-node">&quot;#{gem_home}/cache&quot;</span>, <span class="ruby-value">:write</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">write_cache_file</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">say</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">post_install_message</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">post_install_message</span>.<span class="ruby-identifier">nil?</span>

  <span class="ruby-identifier">run_post_install_hooks</span>

  <span class="ruby-identifier">spec</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pre_install_checks" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pre_install_checks</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="pre_install_checks-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 63</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pre_install_checks</span>
  <span class="ruby-keyword">super</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">validate_bundler_checksum</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:bundler_expected_checksum</span>])
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="spec-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 93</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">provides?</span>(<span class="ruby-string">&quot;&lt; 3.3.12&quot;</span>) <span class="ruby-comment"># RubyGems implementation rescues and re-raises errors before 3.3.12 and we don&#39;t want that</span>
    <span class="ruby-ivar">@package</span>.<span class="ruby-identifier">spec</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-base64digest-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">base64digest!</span><span
                                class="method-args">(digest)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="base64digest-21-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 164</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">base64digest!</span>(<span class="ruby-identifier">digest</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:base64digest!</span>)
    <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">base64digest!</span>
  <span class="ruby-keyword">else</span>
    [<span class="ruby-identifier">digest</span>.<span class="ruby-identifier">digest!</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-string">&quot;m0&quot;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-checksum_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">checksum_type</span><span
                                class="method-args">(checksum)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="checksum_type-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 152</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">checksum_type</span>(<span class="ruby-identifier">checksum</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">checksum</span>.<span class="ruby-identifier">length</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">64</span> <span class="ruby-keyword">then</span> <span class="ruby-value">:hexdigest!</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">44</span> <span class="ruby-keyword">then</span> <span class="ruby-value">:base64digest!</span>
  <span class="ruby-keyword">else</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">InstallError</span>, <span class="ruby-node">&quot;The given checksum for #{spec.full_name} (#{checksum.inspect}) is not a valid SHA256 hexdigest nor base64digest&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-hexdigest-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">hexdigest!</span><span
                                class="method-args">(digest)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="hexdigest-21-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 160</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">hexdigest!</span>(<span class="ruby-identifier">digest</span>)
  <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">hexdigest!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prepare_extension_build" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prepare_extension_build</span><span
                                class="method-args">(extension_dir)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="prepare_extension_build-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 103</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prepare_extension_build</span>(<span class="ruby-identifier">extension_dir</span>)
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">extension_dir</span>, <span class="ruby-value">:create</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-identifier">extension_dir</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;shellwords&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">provides?</span>(<span class="ruby-string">&quot;&gt;= 3.2.25&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-strict_rm_rf" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">strict_rm_rf</span><span
                                class="method-args">(dir)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="strict_rm_rf-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 110</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">strict_rm_rf</span>(<span class="ruby-identifier">dir</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rm_rf</span> <span class="ruby-identifier">dir</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">dir</span>)

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">DirectoryRemovalError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>, <span class="ruby-node">&quot;Could not delete previous installation of `#{dir}`&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_bundler_checksum" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_bundler_checksum</span><span
                                class="method-args">(checksum)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_bundler_checksum-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_gem_installer.rb, line 118</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_bundler_checksum</span>(<span class="ruby-identifier">checksum</span>)
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:disable_checksum_validation</span>]
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">checksum</span>
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">source</span> = <span class="ruby-ivar">@package</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value">:@gem</span>)
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:with_read_io</span>)
      <span class="ruby-identifier">digest</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">with_read_io</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">digest</span> = <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-value">:SHA256</span>).<span class="ruby-identifier">new</span>
        <span class="ruby-identifier">digest</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">16_384</span>) <span class="ruby-keyword">until</span> <span class="ruby-identifier">io</span>.<span class="ruby-identifier">eof?</span>
        <span class="ruby-identifier">io</span>.<span class="ruby-identifier">rewind</span>
        <span class="ruby-identifier">send</span>(<span class="ruby-identifier">checksum_type</span>(<span class="ruby-identifier">checksum</span>), <span class="ruby-identifier">digest</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">digest</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">checksum</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">SecurityError</span>, <span class="ruby-identifier">&lt;&lt;-MESSAGE</span>
<span class="ruby-value">          Bundler cannot continue installing #{spec.name} (#{spec.version}).
          The checksum for the downloaded `#{spec.full_name}.gem` does not match \
          the checksum given by the server. This means the contents of the downloaded \
          gem is different from what was uploaded to the server, and could be a potential security issue.

          To resolve this issue:
          1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
          2. run `bundle install`

          If you wish to continue installing the downloaded gem, and are certain it does not pose a \
          security issue despite the mismatching checksum, do the following:
          1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
          2. run `bundle install`

          (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
          checksum for the downloaded gem was #{digest.inspect}.)
</span><span class="ruby-identifier">          MESSAGE</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

